<div class="modal-header">
    <h3 class="modal-title">数据源管理{{item.role_id=='' && ' - 新增' || ' - 修改'}}</h3>
</div>
<div class="modal-body">
    <form class="form-horizontal form-content" name="edit_Form">
        <div class="form-group">
            <label for="datasource_name" class="control-label col-xs-2">数据源名称</label>
            <div class="col-xs-10">
                <input type="text" ng-model="item.datasource_name" required name="datasource_name"
                       class="form-control" id="datasource_name" placeholder="数据源名称">
            </div>
        </div>
        <div class="form-group">
            <label for="datasource_ip" class="control-label col-xs-2">数据源地址</label>
            <div class="col-xs-10">
                <input type="text" ng-model="item.datasource_ip" required name="datasource_ip"
                       class="form-control" id="datasource_ip" placeholder="数据源IP">
            </div>
        </div>
        <div class="form-group">
            <label for="datasource_port" class="control-label col-xs-2">数据源端口</label>
            <div class="col-xs-10">
                <input type="text" ng-model="item.datasource_port" required name="datasource_port"
                       class="form-control" id="datasource_port" placeholder="数据源端口">
            </div>
        </div>
        <div class="form-group">
            <label for="datasource_user" class="control-label col-xs-2">数据源用户</label>
            <div class="col-xs-10">
                <input type="text" ng-model="item.datasource_user" required name="datasource_user"
                       class="form-control" id="datasource_user" placeholder="数据源用户">
            </div>
        </div>
        <div class="form-group">
            <label for="datasource_password" class="control-label col-xs-2">数据源密码</label>
            <div class="col-xs-10">
                <input type="text" ng-model="item.datasource_password" required name="datasource_password"
                       class="form-control" id="datasource_password" placeholder="数据源密码">
            </div>
        </div>
        <div class="form-group">
            <label for="datasource_database" class="control-label col-xs-2">数据源实例</label>
            <div class="col-xs-10">
                <input type="text" ng-model="item.datasource_database" required name="datasource_database"
                       class="form-control" id="datasource_database" placeholder="数据源实例">
            </div>
        </div>
        <div class="form-group">
            <label for="datasource_type" class="control-label col-xs-2">数据源类型</label>
            <div class="col-xs-10">
                <select name="datasource_type" id="datasource_type" required
                        ng-options="type.value as type.text for type in dataSourceTypes"
                        ng-model="item.datasource_type"></select>
            </div>
        </div>
    </form>
</div>
<div class="text-center">
    <span class="test-info" ng-class="{span_red: !isTestSuccess}">{{testInfo}}</span>
</div>
<div class="modal-footer">
    <button class="btn btn-success" type="button"
            ng-disabled="
            edit_Form.datasource_name.$invalid ||
            edit_Form.datasource_ip.$invalid ||
            edit_Form.datasource_port.$invalid ||
            edit_Form.datasource_user.$invalid ||
            edit_Form.datasource_password.$invalid ||
            edit_Form.datasource_database.$invalid ||
            edit_Form.datasource_type.$invalid
            "
            ng-click="test()">测试</button>
    <button class="btn btn-primary" type="button"
            ng-disabled="
            edit_Form.datasource_name.$invalid ||
            edit_Form.datasource_ip.$invalid ||
            edit_Form.datasource_port.$invalid ||
            edit_Form.datasource_user.$invalid ||
            edit_Form.datasource_password.$invalid ||
            edit_Form.datasource_database.$invalid ||
            edit_Form.datasource_type.$invalid
            "
            ng-click="ok()">确认</button>
    <button class="btn btn-warning" type="button" ng-click="cancel()">取消</button>
</div>